﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using PressMenu2;


class CNewGame
{
    CBigMap bigMap;
    
    cDef Def;
    CUseMouse useMouse;
    GameObjectManager gameObjectManager;
    MyInput input;

    public void LoadContent(ContentManager Content)
    {
        MyResource.LoadContent(Content);

        bigMap = new CBigMap();
        bigMap.Initializing(Content);
        
        useMouse = new CUseMouse();
        useMouse.Initializing(Content);

        Def = new cDef();


        gameObjectManager = new GameObjectManager();
        input = new MyInput();
        
   }

    public void Update(GameTime gameTime,Game game)
    {
        if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            game.Exit();
        bigMap.Update();
        useMouse.Update();

        input.Update();
        gameObjectManager.Update(gameTime, input);
        //gameObjectManager.NewDiaBay();
        if(input.Keyboard.IsKeyDown(Keys.Escape))
            CManager.Show = 0;
    }

    public void Draw(SpriteBatch sb)
    {
        bigMap.Draw(sb);
       
        useMouse.Draw(sb);
        gameObjectManager.Render(sb);

    }
}
